<?php

declare(strict_types=1);

namespace ImiApp\ApiServer\Api\Model\Base;

use Imi\Config\Annotation\ConfigValue;
use Imi\Model\Annotation\Column;
use Imi\Model\Annotation\DDL;
use Imi\Model\Annotation\Entity;
use Imi\Model\Annotation\Table;
use ImiApp\ImiServer\AbstractModel as Model;

/**
 * 题库 基类.
 *
 * @Entity(camel=false, bean=true, incrUpdate=false)
 * @Table(name=@ConfigValue(name="@app.models.ImiApp\ApiServer\Api\Model\Subj.name", default="fa_subj"), usePrefix=false, id={"id"}, dbPoolName=@ConfigValue(name="@app.models.ImiApp\ApiServer\Api\Model\Subj.poolName"))
 * @DDL(sql="CREATE TABLE `fa_subj` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `question` varchar(255) NOT NULL COMMENT '问题',
  `answer` varchar(255) NOT NULL COMMENT '答案',
  `a` varchar(255) DEFAULT NULL COMMENT 'A',
  `b` varchar(255) DEFAULT NULL COMMENT 'B',
  `c` varchar(255) DEFAULT NULL COMMENT 'C',
  `d` varchar(255) DEFAULT NULL COMMENT 'D',
  `createtime` int(10) unsigned DEFAULT NULL COMMENT '添加时间',
  `subj_status` enum('1','2') DEFAULT '1' COMMENT '分类状态:1=正常题目,2=抢答题目',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='题库'", decode="")
 *
 * @property int|null $id 
 * @property string|null $question 问题
 * @property string|null $answer 答案
 * @property string|null $a A
 * @property string|null $b B
 * @property string|null $c C
 * @property string|null $d D
 * @property int|null $createtime 添加时间
 * @property string|null $subjStatus 分类状态:1=正常题目,2=抢答题目
 */
abstract class SubjBase extends Model
{
    /**
     * {@inheritdoc}
     */
    public const PRIMARY_KEY = 'id';

    /**
     * {@inheritdoc}
     */
    public const PRIMARY_KEYS = ["id"];

    /**
     * id.
     * @Column(name="id", type="int", length=10, accuracy=0, nullable=false, default="", isPrimaryKey=true, primaryKeyIndex=0, isAutoIncrement=true, unsigned=true, virtual=false)
     * @var int|null
     */
    protected ?int $id = NULL;

    /**
     * 获取 id.
     *
     * @return int|null
     */
    public function getId(): ?int
    {
        return $this->id;
    }

    /**
     * 赋值 id.
     * @param int|null $id id
     * @return static
     */
    public function setId($id)
    {
        $this->id = null === $id ? null : (int)$id;
        return $this;
    }

    /**
     * 问题.
     * question
     * @Column(name="question", type="varchar", length=255, accuracy=0, nullable=false, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var string|null
     */
    protected ?string $question = NULL;

    /**
     * 获取 question - 问题.
     *
     * @return string|null
     */
    public function getQuestion(): ?string
    {
        return $this->question;
    }

    /**
     * 赋值 question - 问题.
     * @param string|null $question question
     * @return static
     */
    public function setQuestion($question)
    {
        $this->question = null === $question ? null : (string)$question;
        return $this;
    }

    /**
     * 答案.
     * answer
     * @Column(name="answer", type="varchar", length=255, accuracy=0, nullable=false, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var string|null
     */
    protected ?string $answer = NULL;

    /**
     * 获取 answer - 答案.
     *
     * @return string|null
     */
    public function getAnswer(): ?string
    {
        return $this->answer;
    }

    /**
     * 赋值 answer - 答案.
     * @param string|null $answer answer
     * @return static
     */
    public function setAnswer($answer)
    {
        $this->answer = null === $answer ? null : (string)$answer;
        return $this;
    }

    /**
     * A.
     * a
     * @Column(name="a", type="varchar", length=255, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var string|null
     */
    protected ?string $a = NULL;

    /**
     * 获取 a - A.
     *
     * @return string|null
     */
    public function getA(): ?string
    {
        return $this->a;
    }

    /**
     * 赋值 a - A.
     * @param string|null $a a
     * @return static
     */
    public function setA($a)
    {
        $this->a = null === $a ? null : (string)$a;
        return $this;
    }

    /**
     * B.
     * b
     * @Column(name="b", type="varchar", length=255, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var string|null
     */
    protected ?string $b = NULL;

    /**
     * 获取 b - B.
     *
     * @return string|null
     */
    public function getB(): ?string
    {
        return $this->b;
    }

    /**
     * 赋值 b - B.
     * @param string|null $b b
     * @return static
     */
    public function setB($b)
    {
        $this->b = null === $b ? null : (string)$b;
        return $this;
    }

    /**
     * C.
     * c
     * @Column(name="c", type="varchar", length=255, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var string|null
     */
    protected ?string $c = NULL;

    /**
     * 获取 c - C.
     *
     * @return string|null
     */
    public function getC(): ?string
    {
        return $this->c;
    }

    /**
     * 赋值 c - C.
     * @param string|null $c c
     * @return static
     */
    public function setC($c)
    {
        $this->c = null === $c ? null : (string)$c;
        return $this;
    }

    /**
     * D.
     * d
     * @Column(name="d", type="varchar", length=255, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var string|null
     */
    protected ?string $d = NULL;

    /**
     * 获取 d - D.
     *
     * @return string|null
     */
    public function getD(): ?string
    {
        return $this->d;
    }

    /**
     * 赋值 d - D.
     * @param string|null $d d
     * @return static
     */
    public function setD($d)
    {
        $this->d = null === $d ? null : (string)$d;
        return $this;
    }

    /**
     * 添加时间.
     * createtime
     * @Column(name="createtime", type="int", length=10, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=true, virtual=false)
     * @var int|null
     */
    protected ?int $createtime = NULL;

    /**
     * 获取 createtime - 添加时间.
     *
     * @return int|null
     */
    public function getCreatetime(): ?int
    {
        return $this->createtime;
    }

    /**
     * 赋值 createtime - 添加时间.
     * @param int|null $createtime createtime
     * @return static
     */
    public function setCreatetime($createtime)
    {
        $this->createtime = null === $createtime ? null : (int)$createtime;
        return $this;
    }

    /**
     * 分类状态:1=正常题目,2=抢答题目.
     * subj_status
     * @Column(name="subj_status", type="enum", length=0, accuracy=0, nullable=true, default="1", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var string|null
     */
    protected ?string $subjStatus = '1';

    /**
     * 获取 subjStatus - 分类状态:1=正常题目,2=抢答题目.
     *
     * @return string|null
     */
    public function getSubjStatus(): ?string
    {
        return $this->subjStatus;
    }

    /**
     * 赋值 subjStatus - 分类状态:1=正常题目,2=抢答题目.
     * @param string|null $subjStatus subj_status
     * @return static
     */
    public function setSubjStatus($subjStatus)
    {
        $this->subjStatus = null === $subjStatus ? null : (string)$subjStatus;
        return $this;
    }

}
